<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>用户表</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="online/template/ledefault/css/vendor.css">
<link rel="stylesheet"
	href="online/template/ledefault/css/bootstrap-theme.css">
<link rel="stylesheet"
	href="online/template/ledefault/css/bootstrap.css">
<link rel="stylesheet" href="online/template/ledefault/css/app.css">

<link rel="stylesheet" href="plug-in/Validform/css/metrole/style.css"
	type="text/css" />
<link rel="stylesheet"
	href="plug-in/Validform/css/metrole/tablefrom.css" type="text/css" />

<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.js"></script>
<script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
<script type="text/javascript"
	src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
<script type="text/javascript" src="plug-in/easyui/locale/zh-cn.js"></script>
<script type="text/javascript" src="plug-in/tools/syUtil.js"></script>
<script type="text/javascript"
	src="plug-in/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js"></script>
<script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/tools/easyuiextend.js"></script>
<script type="text/javascript"
	src="plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
<script type="text/javascript"
	src="plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
<script type="text/javascript"
	src="plug-in/Validform/js/datatype_zh-cn.js"></script>
<script type="text/javascript"
	src="plug-in/Validform/plugin/passwordStrength/passwordStrength-min.js"></script>
<script type="text/javascript"
	src="plug-in/umeditor/lang/zh-cn/zh-cn.js"></script>
<link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css"
	type="text/css" />
<script type="text/javascript"	src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
<script type="text/javascript">
	//编写自定义JS代码
</script>
</head>

<body>

	<t:formvalid formid="formobj" dialog="true" usePlugin="password"
		layout="div" action="xyhJzUserController.do?doAdd" tiptype="1"
		callback="jeecgFormFileCallBack@Override">
		<input type="hidden" id="btn_sub" class="btn_sub" />
		<input type="hidden" id="id" name="id" />
		<div class="tab-wrapper">
			<!-- tab -->
			<ul class="nav nav-tabs">
				<li role="presentation" class="active"><a
					href="javascript:void(0);">用户信息</a></li>
			</ul>
			<!-- tab内容 -->
			<div class="con-wrapper" id="con-wrapper1" style="display: block;">
				<div class="row form-wrapper">
				
				<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>用户名：</b>
						</div>
						<div class="col-xs-5">
							<input id="nickname" name="nickname" type="text"   sucmsg="验证通过"  nullmsg="请输入用户名！"  errormsg=" "
								class="form-control" datatype="*"> <span
								class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">用户名</label>
						</div>
					</div>
					
					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>密码：</b>
						</div>
						<div class="col-xs-5">
							<input id="pwd" name="pwd" type="password" plugin="passwordStrength" class="form-control" datatype="*6-16"> 
							<div class="passwordStrength" style="display:none;"><b>密码强度：</b> <span>弱</span><span>中</span><span class="last">强</span></div>
								<span class="Validform_checktip"
								style="float:left;height:0px;"></span> <label
								class="Validform_label" style="display: none">密码</label>
						</div>
					</div>
					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>重复密码：</b>
						</div>
						<div class="col-xs-5">
							<input id="checkpwd" name="checkpwd" type="password" class="form-control"  recheck="pwd"  errormsg="您两次输入的账号密码不一致！">
							 <span class="Validform_checktip"style="float:left;height:0px;"></span> 
								<label class="Validform_label" style="display: none">重复密码</label>
						</div>
					</div>

					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>性别：</b>
						</div>
						<div class="col-xs-3">
							<t:dictSelect field="sex" type="list"	extendJson="{class:'form-control'}"  typeGroupCode="sex"  defaultVal="0"
								hasLabel="false" title="性别"></t:dictSelect>
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">性别</label>
						</div>
					</div>
					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>手机号：</b>
						</div>
						<div class="col-xs-5">
							<input id="phone" name="phone" type="text" class="form-control"
								datatype="m"> <span class="Validform_checktip"
								style="float:left;height:0px;"></span> <label
								class="Validform_label" style="display: none">手机号</label>
						</div>
					</div>

					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>qq：</b>
						</div>
						<div class="col-xs-5">
							<input id="qq" name="qq" type="text" class="form-control">
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">qq</label>
						</div>
					</div>


					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>是否校验手机号：</b>
						</div>
						<div class="col-xs-3">
							<t:dictSelect field="isCheckPhone" type="list"
								extendJson="{class:'form-control'}" typeGroupCode="sf_yn" defaultVal="N"
								hasLabel="false" title="是否校验手机号"></t:dictSelect>
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">是否校验手机号</label>
						</div>
					</div>


					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>邮箱：</b>
						</div>
						<div class="col-xs-5">
							<input id="email" name="email" type="text" class="form-control"
								datatype="e"> <span class="Validform_checktip"
								style="float:left;height:0px;"></span> <label
								class="Validform_label" style="display: none">邮箱</label>
						</div>
					</div>


				<!-- 	<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>头像：</b>
						</div>
						<div class="col-xs-5">
							<table></table>
							<div class="form jeecgDetail">
								<script type="text/javascript">
									var serverMsg = "";
									$(function() {
										$('#img')
												.uploadify(
														{
															buttonText : '选择图片',
															swf : 'plug-in/uploadify/uploadify.swf',
															auto : false,
															progressData : 'speed',
															multi : false,
															height : 25,
															overrideEvents : [ 'onDialogClose' ],
															fileTypeDesc : '文件格式:',
															queueID : 'filediv_file',
															fileTypeExts : '*.pdf;*.jpg;*.gif;*.png',
															fileSizeLimit : '5MB',
															uploader : 'cgUploadController.do?saveFiles&jsessionid='
																	+ $(
																			"#sessionUID")
																			.val()
																	+ '',
															onUploadStart : function(
																	file) {
																var cgFormId = $(
																		"input[name='id']")
																		.val();
																$('#img')
																		.uploadify(
																				"settings",
																				"formData",
																				{
																					'cgFormId' : cgFormId,
																					'cgFormName' : 'xyh_jz_user',
																					'cgFormField' : 'IMG'
																				});
															},
															onQueueComplete : function(
																	queueData) {
																var win = frameElement.api.opener;
																win
																		.reloadTable();
																win
																		.tip(serverMsg);
																frameElement.api
																		.close();
															},
															onUploadSuccess : function(
																	file, data,
																	response) {
																var d = $
																		.parseJSON(data);
																if (d.success) {
																	var win = frameElement.api.opener;
																	serverMsg = d.msg;
																}
															},
															onFallback : function() {
																tip("您未安装FLASH控件，无法上传图片！请安装FLASH控件后再试")
															},
															onSelectError : function(
																	file,
																	errorCode,
																	errorMsg) {
																switch (errorCode) {
																case -100:
																	tip("上传的文件数量已经超出系统限制的"
																			+ $(
																					'#file')
																					.uploadify(
																							'settings',
																							'queueSizeLimit')
																			+ "个文件！");
																	break;
																case -110:
																	tip("文件 ["
																			+ file.name
																			+ "] 大小超出系统限制的"
																			+ $(
																					'#file')
																					.uploadify(
																							'settings',
																							'fileSizeLimit')
																			+ "大小！");
																	break;
																case -120:
																	tip("文件 ["
																			+ file.name
																			+ "] 大小异常！");
																	break;
																case -130:
																	tip("文件 ["
																			+ file.name
																			+ "] 类型不正确！");
																	break;
																}
															},
															onUploadProgress : function(
																	file,
																	bytesUploaded,
																	bytesTotal,
																	totalBytesUploaded,
																	totalBytesTotal) {
															}
														});
									});
								</script>
								<span id="file_uploadspan"><input type="file" name="img"
									id="img" /></span>
							</div>
							<div class="form" id="filediv_file"></div>
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">头像</label>
						</div>
					</div> -->


					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>描述：</b>
						</div>
						<div class="col-xs-8">
							<textarea id="description" class="form-control" rows="6"
								name="description"></textarea>
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">描述</label>
						</div>
					</div>
					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>会员等级：</b>
						</div>
						<div class="col-xs-3">
							<t:dictSelect field="rank" type="list"
								extendJson="{class:'form-control'}" typeGroupCode="mem_rank" defaultVal="3"
								hasLabel="false" title="会员等级"></t:dictSelect>
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">会员等级</label>
						</div>
					</div>

					<div class="row" id="sub_tr" style="display: none;">
						<div class="col-xs-12 layout-header">
							<div class="col-xs-6"></div>
							<div class="col-xs-6">
								<button type="button" onclick="neibuClick();"
									class="btn btn-default">提交</button>
							</div>
						</div>
					</div>
				</div>
			</div>

			<div class="con-wrapper" id="con-wrapper2" style="display: block;"></div>
		</div>
	</t:formvalid>
	<script type="text/javascript">
		function jeecgFormFileCallBack(data) {
			if (data.success == true) {
				uploadFile(data);
			} else {
				if (data.responseText == '' || data.responseText == undefined) {
					$.messager.alert('错误', data.msg);
					$.Hidemsg();
				} else {
					try {
						var emsg = data.responseText.substring(
								data.responseText.indexOf('错误描述'),
								data.responseText.indexOf('错误信息'));
						$.messager.alert('错误', emsg);
						$.Hidemsg();
					} catch (ex) {
						$.messager.alert('错误', data.responseText + '');
					}
				}
				return false;
			}
			if (!neibuClickFlag) {
				var win = frameElement.api.opener;
				win.reloadTable();
			}
		}
		function upload() {
			$('#img').uploadify('upload', '*');
		}

		var neibuClickFlag = false;
		function neibuClick() {
			neibuClickFlag = true;
			$('#btn_sub').trigger('click');
		}
		function cancel() {
			$('#img').uploadify('cancel', '*');
		}
		function uploadFile(data) {
			if (!$("input[name='id']").val()) {
				if (data.obj != null && data.obj != 'undefined') {
					$("input[name='id']").val(data.obj.id);
				}
			}
			if ($(".uploadify-queue-item").length > 0) {
				upload();
			} else {
				if (neibuClickFlag) {
					alert(data.msg);
					neibuClickFlag = false;
				} else {
					var win = frameElement.api.opener;
					win.reloadTable();
					win.tip(data.msg);
					frameElement.api.close();
				}
			}
		}
	</script>

	<script type="text/javascript">
		$(function() {
			//查看模式情况下,删除和上传附件功能禁止使用
			if (location.href.indexOf("load=detail") != -1) {
				$(".jeecgDetail").hide();
			}

			if (location.href.indexOf("mode=read") != -1) {
				//查看模式控件禁用
				$("#formobj").find(":input").attr("disabled", "disabled");
			}
			if (location.href.indexOf("mode=onbutton") != -1) {
				//其他模式显示提交按钮
				$("#sub_tr").show();
			}
		});

		var neibuClickFlag = false;
		function neibuClick() {
			neibuClickFlag = true;
			$('#btn_sub').trigger('click');
		}
	</script>
</body>
<script src="webpage/com/jianzhi/user/xyhJzUser.js"></script>
</html>